

rm -rf TEST
make clean
make server
make client
make server-admin
make genuid
mkdir TEST
choices=7
cd TEST
../genuid 25
gnome-terminal --command="bash -c '../server --choices=$choices; echo hit ENTER...; read'"
sleep 3
../server-admin --reg
sleep 1
for ((i = 0; i < 19; i++)); do echo $i; ../client --uid=$i --passwd=`cat $i` --keyfile=K$i --reg; done
sleep 2
../server-admin --tally-keys
sleep 1
for ((i = 0; i < 19; i++)); do echo $i; ../client --keyfile=K$i --tally-key; done
sleep 2
../server-admin --vote
sleep 1
for ((i = 0; i < 19; i++));
do 
	echo $i
	../client --keyfile=K$i --vote=$((`cat /dev/urandom|od -N1 -An -i` % $choices))
done
sleep 2
../server-admin --tally
sleep 1
for ((i = 0; i < 19; i++)); do echo $i; ../client --keyfile=K$i --tally; done
sleep 2
../server-admin --done

